package com.itany.corejava.day11;

import java.io.IOException;
import java.util.Properties;
import java.util.Set;

public class TestProperties {

    public static void main(String[] args) throws IOException {


        Properties p=new Properties();

        // p.put("aaa","111");
        // p.put("bbb","222");
        // p.put("ccc","333");
        //
        // System.out.println(p.get("bbb"));

        // p.setProperty("aaa","111");
        // p.setProperty("bbb","222");
        // p.setProperty("ccc","333");
        //
        // System.out.println(p.getProperty("bbb"));


        p.load(TestProperties.class
                             .getClassLoader()
                             .getResourceAsStream("com/itany/corejava/day11/info.properties"));


        System.out.println(p.getProperty("a"));
        System.out.println(p.getProperty("b"));
        System.out.println(p.getProperty("c"));
        System.out.println(p.getProperty("d"));
        System.out.println(p.getProperty("e"));

        Set<String> keys=p.stringPropertyNames();
        for (String key : keys) {
            System.out.println(key+"="+p.getProperty(key));
        }







    }

}
